home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / GMS / Source / Asm / Rasterlists / AGAMirror.s < prev    next >
Encoding:
Text File  |  1997-05-01  |  3.6 KB  |  150 lines

  1. ;-------T-------T------------------------T----------------------------------;
  2. ;AGA Mirror Demo
  3. ;---------------
  4. ;Demo of the mirroring effect.  When this effect is combined with a
  5. ;decrease in palette values at the same line, you can create the illusion of
  6. ;water.
  7. ;
  8. ;Use  the  mouse  to  move  the mirror up and down.  LMB exits.
  9.  
  10.     INCDIR    "INCLUDES:"
  11.     INCLUDE    "games/games_lib.i"
  12.     INCLUDE    "games/games.i"
  13.  
  14. CALL    MACRO
  15.     jsr    _LVO\1(a6)
  16.     ENDM
  17.  
  18.     SECTION    "MirrorDemo",CODE
  19.  
  20. ;===========================================================================;
  21. ;                             INITIALISE DEMO
  22. ;===========================================================================;
  23.  
  24.     STARTGMS
  25.  
  26. Start:    MOVEM.L    A0-A6/D1-D7,-(SP)
  27.     move.l    GMSBase(pc),a6
  28.     lea    ScreenTags(pc),a0
  29.     CALL    AddScreen
  30.     tst.l    d0
  31.     beq.s    .Error_Screen
  32.  
  33.     move.l    Screen(pc),a0
  34.     move.l    GS_MemPtr1(a0),a1    ;a1 = Destination.
  35.     lea    PackedPicFile(pc),a0    ;a0 = File Name.
  36.     CALL    SmartLoad
  37.     tst.l    d0
  38.     beq.s    .ReturnToDOS
  39.  
  40.     move.l    Screen(pc),a0
  41.     CALL    ShowScreen
  42.  
  43.     CALL    InitJoyPorts
  44.  
  45.     bsr.s    Loop
  46.  
  47. .ReturnToDOS
  48.     move.l    GMSBase(pc),a6
  49.     move.l    Screen(pc),a0
  50.     CALL    DeleteScreen
  51. .Error_Screen
  52.     MOVEM.L    (SP)+,A0-A6/D1-D7
  53.     moveq    #ERR_OK,d0
  54.     rts
  55.  
  56. ;===========================================================================;
  57. ;                                MAIN CODE
  58. ;===========================================================================;
  59.  
  60. Loop:    move.l    Screen(pc),a0
  61.     CALL    WaitVBL
  62.     CALL    UpdateRasterLines
  63.  
  64.     moveq    #JPORT1,d0
  65.     CALL    ReadMouse
  66.     ext.w    d0
  67.     add.w    d0,RasterList+2
  68.  
  69. .chk129    cmp.w    #129,RasterList+2
  70.     bgt.s    .chk256
  71.     move.w    #129,RasterList+2
  72.  
  73. .chk256    cmp.w    #255,RasterList+2
  74.     blt.s    .chklmb
  75.     move.w    #255,RasterList+2
  76.  
  77. .chklmb    btst    #MB_LMB,d0
  78.     beq.s    Loop
  79.  
  80.     moveq    #0,d0    ;Fade to black.
  81.     moveq    #1,d1
  82.     lea    Palette(pc),a1
  83.     moveq    #$000000,d2
  84.     moveq    #00,d3
  85.     move.l    #128,d4
  86. .Fade    CALL    WaitVBL
  87.     CALL    PaletteToColour
  88.     tst.w    d0
  89.     bne.s    .Fade
  90.     rts
  91.  
  92. ;===========================================================================;
  93. ;                                  DATA
  94. ;===========================================================================;
  95.  
  96. ScreenTags:
  97.     dc.l    TAGS_GAMESCREEN
  98. Screen:    dc.l    0
  99.     dc.l    GSA_Palette,Palette
  100.     dc.l    GSA_Rasterlist,Rasterlist
  101.     dc.l    GSA_ScrWidth,320
  102.     dc.l    GSA_ScrHeight,256
  103.     dc.l    GSA_Planes,7
  104.     dc.l    GSA_ScrMode,LORES
  105.     dc.l    GSA_ScrType,ILBM
  106.     dc.l    TAGEND
  107.  
  108. Rasterlist:
  109.     WAITLINE 164
  110.     MIRROR
  111.     RASTEND
  112.  
  113. Palette    dc.l    $000000,$FFFFFF,$FAF5F2,$FAE8E7
  114.     dc.l    $EEDED5,$E8D4C8,$DDC0AF,$D7B5A2
  115.     dc.l    $D1AC96,$DCA491,$CBA38B,$C5997E
  116.     dc.l    $BD8E74,$B5846A,$AD7A5F,$A57056
  117.     dc.l    $9D674D,$955D44,$8C533B,$844B34
  118.     dc.l    $7C432D,$743B26,$6C3320,$642D1B
  119.     dc.l    $5C2616,$532010,$4A1D0C,$411A09
  120.     dc.l    $381606,$2F1204,$260F02,$1D0C00
  121.     dc.l    $AC783A,$A67139,$A06C39,$986638
  122.     dc.l    $995F36,$906037,$8C5C36,$945733
  123.     dc.l    $865735,$905030,$7E5133,$8D4B2E
  124.     dc.l    $764B31,$6E4630,$8A462D,$64412B
  125.     dc.l    $5D3D27,$593A24,$543822,$50351F
  126.     dc.l    $4B341D,$47301A,$592218,$402D17
  127.     dc.l    $382813,$3B2007,$302310,$2B200D
  128.     dc.l    $331100,$430907,$3C0504,$2E0202
  129.     dc.l    $B48038,$B7743D,$AE6350,$A85D4A
  130.     dc.l    $A35644,$9E503E,$994A39,$944534
  131.     dc.l    $9F4336,$8E3F30,$87412B,$87382A
  132.     dc.l    $823628,$803226,$792C21,$72251C
  133.     dc.l    $E1AB98,$DBA28C,$D79C89,$D29582
  134.     dc.l    $CD8D7A,$C88672,$C27E6B,$BD7764
  135.     dc.l    $B8705D,$B36A57,$BB5244,$AD4A3D
  136.     dc.l    $C8594A,$7F7444,$847D49,$67271E
  137.     dc.l    $6C2219,$651D15,$5E1711,$57130E
  138.     dc.l    $500F0B,$4A0C09,$350303,$270000
  139.     dc.l    $89874E,$8C8E53,$8C9358,$8E9D62
  140.     dc.l    $C6904A,$9AA467,$CD9E51,$AFAE6F
  141.     dc.l    $E3D765,$D5AE58,$BCAD78,$C1AC7C
  142.     dc.l    $CBAA82,$D5A588,$EAA09B,$ECA7A2
  143.     dc.l    $EDADA9,$EFB5B1,$F0BBB8,$F2C2BF
  144.     dc.l    $F4CBC8,$F5D1CF,$F7D9D7,$FDF7F7
  145.  
  146. PackedPicFile:
  147.     dc.b    "GMS:demos/data/Yattering128.pak",0
  148.     even
  149.  
  150.